package parkingSpace

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type ParkingSpaceRouter struct {
}

// InitParkingSpaceRouter 初始化 parkingSpace表 路由信息
func (s *ParkingSpaceRouter) InitParkingSpaceRouter(Router *gin.RouterGroup) {
	parkingSpacesRouter := Router.Group("parkingSpaces").Use(middleware.OperationRecord())
	parkingSpacesRouterWithoutRecord := Router.Group("parkingSpaces")
	var parkingSpacesApi = v1.ApiGroupApp.ParkingSpaceApiGroup.ParkingSpaceApi
	{
		parkingSpacesRouter.POST("createParkingSpace", parkingSpacesApi.CreateParkingSpace)             // 新建parkingSpace表
		parkingSpacesRouter.DELETE("deleteParkingSpace", parkingSpacesApi.DeleteParkingSpace)           // 删除parkingSpace表
		parkingSpacesRouter.DELETE("deleteParkingSpaceByIds", parkingSpacesApi.DeleteParkingSpaceByIds) // 批量删除parkingSpace表
		parkingSpacesRouter.PUT("updateParkingSpace", parkingSpacesApi.UpdateParkingSpace)              // 更新parkingSpace表
	}
	{
		parkingSpacesRouterWithoutRecord.GET("findParkingSpace", parkingSpacesApi.FindParkingSpace)       // 根据ID获取parkingSpace表
		parkingSpacesRouterWithoutRecord.GET("getParkingSpaceList", parkingSpacesApi.GetParkingSpaceList) // 获取parkingSpace表列表
		parkingSpacesRouterWithoutRecord.GET("getParkingSpaceListNoPage", parkingSpacesApi.GetParkingSpaceListNoPage)
	}
}
